import random
import os
import traceback

def Multiplication():
    try:
        file1=open("D:\\99test.txt","w",encoding="utf-8")
        for i in range(1, 10):
            if i!=1:
                file1.write("\n")
            # if i==1:
            #     print('%d * %d= %d'%(i,i,i*i))
            for y in range(1, i + 1):
                strn='%d * %d= %d' % (i, y, i * y)+'\t'
                file1.write(strn)
                y += 1
            i += 1
    except:
        traceback.print_exc()
    finally:
        file1.close()



if __name__ == '__main__':
    Multiplication()